Developer Documentation

QuickTime 4 API Documentation

Programming With QuickTime VR

| Previous | Chapter Contents | Chapter Top | Next |

Manipulating Viewing Angles and Zooming

The QuickTime VR Manager provides functions that you can use to manipulate the viewing angles and zooming characteristics of a QuickTime VR movie. Note that the parameters to these functions that specify angles are always interpreted in the current angular unit (degrees or radians) set by a previous call to the QTVRSetAngularUnits function. The default angular unit is degrees.

QTVRGetPanAngle

You can use the QTVRGetPanAngle function to get the pan angle of a QuickTime VR movie.

float QTVRGetPanAngle (QTVRInstance qtvr);
qtvr
An instance of a QuickTime VR movie.
function result
A floating-point value that represents the current pan angle of the specified movie.

DESCRIPTION

The QTVRGetPanAngle function returns, as its function result, a floating-point value that represents the current pan angle of the QuickTime VR movie specified by the qtvr parameter.

SEE ALSO

Use QTVRSetPanAngle (next) to set the pan angle of a movie. Listing 2-3 illustrates the use of QTVRGetPanAngle .

QTVRSetPanAngle

You can use the QTVRSetPanAngle function to set the pan angle of a QuickTime VR movie.

OSErr QTVRSetPanAngle (QTVRInstance qtvr, floatpanAngle);
qtvr
An instance of a QuickTime VR movie.
panAngle
The desired pan angle of the specified movie.
function result
A result code.

DESCRIPTION

The QTVRSetPanAngle function sets the pan angle of the QuickTime VR movie specified by the qtvr parameter to the value specified by the panAngle parameter. That value is constrained by the maximum and minimum pan angles of the movie. If the angle falls outside of those constraints and the control setting kQTVRWrapPan is disabled, the angle is set to the minimum or maximum, whichever is closer. If wrapping is enabled, the pan angle is clipped to fall within the constraints. Pan angle values are also clipped if the requested pan angle, when combined with the current tilt angle and field of view, would cause an image to lie outside the current constraints.

QTVRSetPanAngle returns the result code constraintReachedErr if wrapping is off and the angle is set to the minimum or maximum constraint value.

SPECIAL CONSIDERATIONS

The pan and tilt angles are subject to the current pan and tilt range constraints, as imposed by the viewing limits and the current field of view. Accordingly, if you want to change the field of view, you should do so before adjusting the pan or tilt angles. Otherwise, the pan and tilt angles are clipped against the current field of view, which may result in an incorrect view when you alter the field of view.

SEE ALSO

Use QTVRGetPanAngle to get the pan angle of a movie. Use QTVRGetViewingLimits to get the current viewing limits of a movie. Listing 2-3 illustrates the use of QTVRSetPanAngle . Use QTVRSetControlSetting to control the setting of kQTVRWrapPan .

QTVRGetTiltAngle

You can use the QTVRGetTiltAngle function to get the tilt angle of a QuickTime VR movie.

float QTVRGetTiltAngle (QTVRInstance qtvr);
qtvr
An instance of a QuickTime VR movie.
function result
A floating-point value that represents the current tilt angle of the specified movie.

DESCRIPTION

The QTVRGetTiltAngle function returns, as its function result, a floating-point value that represents the current tilt angle of the QuickTime VR movie specified by the qtvr parameter.

SEE ALSO

Use QTVRSetTiltAngle (next) to set the tilt angle of a movie. Listing 2-3 illustrates the use of QTVRGetTiltAngle .

QTVRSetTiltAngle

You can use the QTVRSetTiltAngle function to set the tilt angle of a QuickTime VR movie.

OSErr QTVRSetTiltAngle (QTVRInstance qtvr, floattiltAngle);
qtvr
An instance of a QuickTime VR movie.
tiltAngle
The desired tilt angle of the specified movie.
function result
A result code.

DESCRIPTION

The QTVRSetTiltAngle function sets the tilt angle of the QuickTime VR movie specified by the qtvr parameter to the value specified by the tiltAngle parameter. That value is constrained by the maximum and minimum tilt angles of the movie. If the angle falls outside of those constraints and the control setting kQTVRWrapTilt is disabled, the angle is set to the minimum or maximum, whichever is closer. If wrapping is enabled, the tilt angle is clipped to fall within the constraints. Tilt angle values are also clipped if the requested tilt angle, when combined with the current pan angle and field of view, would cause an image to lie outside the current constraints.

QTVRSetTiltAngle returns the result code constraintReachedErr if wrapping is off and the angle is set to the minimum or maximum constraint value.

SPECIAL CONSIDERATIONS

The pan and tilt angles are subject to the current pan and tilt range constraints, as imposed by the viewing limits and the current field of view. Accordingly, if you want to change the field of view, you should do so before adjusting the pan or tilt angles. Otherwise, the pan and tilt angles are clipped against the current field of view, which may result in an incorrect view when you alter the field of view.

SEE ALSO

Use QTVRGetTiltAngle to get the tilt angle of a movie. Use QTVRGetViewingLimits to get the current viewing limits of a movie. Listing 2-3 illustrates the use of QTVRSetTiltAngle . Use QTVRSetControlSetting to control the setting of kQTVRWrapTilt .

QTVRGetFieldOfView

You can use the QTVRGetFieldOfView function to get the vertical field of view of a QuickTime VR movie.

float QTVRGetFieldOfView (QTVRInstance qtvr);
qtvr
An instance of a QuickTime VR movie.
function result
The current vertical field of view of the specified movie.

DESCRIPTION

The QTVRGetFieldOfView function returns, as its function result, the current vertical field of view of the QuickTime VR movie specified by the qtvr parameter. The vertical field of view is a floating-point value that specifies the angle created by the two lines that connect the viewpoint to the top and bottom of the image.

SEE ALSO

Use QTVRSetFieldOfView (next) to set the vertical field of view of a QuickTime VR movie. Listing 2-4 illustrates the use of QTVRGetFieldOfView .

QTVRSetFieldOfView

You can use the QTVRSetFieldOfView function to set the vertical field of view of a QuickTime VR movie.

OSErr QTVRSetFieldOfView (QTVRInstance qtvr, floatfieldOfView);
qtvr
An instance of a QuickTime VR movie.
fieldOfView
The desired vertical field of view for the specified movie.
function result
A result code.

DESCRIPTION

The QTVRSetFieldOfView function sets the vertical field of view of the QuickTime VR movie specified by the qtvr parameter to the value specified by the fieldOfView parameter. That value is constrained by the maximum field of view of the movie. Values that lie outside that limit are clipped to the maximum. Pan and tilt angle values are also clipped if, when combined with the current field of view, they would cause an image to lie outside the current constraints.

If the control setting kQTVRCanZoom is disabled, the field of view is unchanged and QTVRSetFieldOfView returns the result code constraintReachedErr .

SPECIAL CONSIDERATIONS

The pan and tilt angles are subject to the current pan and tilt range constraints, as imposed by the viewing limits and the current field of view. Accordingly, if you want to change the field of view, you should do so before adjusting the pan or tilt angles. Otherwise, the pan and tilt angles are clipped against the current field of view, which may result in an incorrect view when you alter the field of view.

SEE ALSO

Use QTVRGetFieldOfView to get the vertical field of view of a QuickTime VR movie. Listing 2-4 illustrates the use of QTVRSetFieldOfView . Use QTVRSetControlSetting to control the setting of kQTVRCanZoom .

QTVRGetViewCenter

You can use the QTVRGetViewCenter function to get the view center of a QuickTime VR movie.

OSErr QTVRGetViewCenter (QTVRInstance qtvr, QTVRFloatPoint *viewCenter);
qtvr
An instance of a QuickTime VR movie.
viewCenter
On entry, a pointer to a QTVRFloatPoint structure. On exit, that structure contains the current view center of the specified movie.
function result
A result code.

DESCRIPTION

The QTVRGetViewCenter function returns, in the QTVRFloatPoint structure pointed to by the viewCenter parameter, the x and y coordinates of the current view center of the QuickTime VR movie specified by the qtvr parameter.

SPECIAL CONSIDERATIONS

QTVRGetViewCenter is valid only for object nodes.

SEE ALSO

Use QTVRSetViewCenter (next) to set the view center of a movie.

QTVRSetViewCenter

You can use the QTVRSetViewCenter function to set the view center of a QuickTime VR movie.

OSErr QTVRSetViewCenter (
                     QTVRInstance qtvr,
                     const QTVRFloatPoint *viewCenter);
qtvr
An instance of a QuickTime VR movie.
viewCenter
A pointer to a QTVRFloatPoint structure that contains the desired view center of the specified movie.
function result
A result code.

DESCRIPTION

The QTVRSetViewCenter function sets the view center of the QuickTime VR movie specified by the qtvr parameter to the fixed point specified by the viewCenter parameter. That point is constrained by the current field of view of the movie. The values you pass in the QTVRFloatPoint structure are adjusted so that the magnified area does not show anything outside the view.

If the kQTVRTranslation control setting is disabled, the QTVRSetViewCenter function returns the result code constraintReachedErr and doesn't change the current view center.

SPECIAL CONSIDERATIONS

QTVRSetViewCenter is valid only for object nodes.

SEE ALSO

Use QTVRGetViewCenter to get the view center of a movie. Use QTVRSetControlSetting to control the setting of kQTVRTranslation .

QTVRNudge

You can use the QTVRNudge function to turn one step in a particular direction and display the new view.

OSErr QTVRNudge (QTVRInstance qtvr, QTVRNudgeControl direction);
qtvr
An instance of a QuickTime VR movie.
direction
The direction of the nudge. See "Nudge Directions" for a description of the values you can pass in this parameter.
function result
A result code.

DESCRIPTION

The QTVRNudge function adjusts the current view of the movie specified by the qtvr parameter as indicated by the direction parameter. In particular, QTVRNudge turns one step in the indicated direction and displays the new view.

For example, to move to the next view that is right and up from the current view, set the direction parameter to kQTVRUpRight (that is, /4 radians, or 45 degrees). Any value of the direction parameter that is not predefined is mapped to the closest defined value. For objects, if no view is located at the adjacent object view defined by the nudge direction and wrapping is off in the desired direction, then QTVRNudge remains at the current view and returns the result code constraintReachedErr .

For objects, QTVRNudge is useful for changing to an adjacent view without having to know the new pan and tilt angles.

The direction of the nudge is affected by the current control settings. See "Control Settings" for more information.

SEE ALSO

Use QTVRSetPanAngle and QTVRSetTiltAngle to move to a new view specified using pan and tilt angles.

QTVRInteractionNudge

You can use the QTVRInteractionNudge function either to translate the image and display the new view or to rotate the object in a particular direction and display its new appearance. The current setting of the interaction property for kQTVRInteractionNudgeMode determines whether the nudge action translates the image or rotates the object.

OSErr QTVRInteractionNudge (QTVRInstance qtvr, QTVRNudgeControl direction);

qtvr
An instance of a QuickTime VR movie.
direction
The direction of the nudge. See "Nudge Directions" for a description of the values you can pass in this parameter. See "Nudge Mode" for a description of the way you set the nudge mode.
function result
A result code.

DESCRIPTION

The QTVRInteractionNudge function adjusts the current view of the movie specified by the qtvr parameter as indicated by the direction parameter. The type of adjustment depends on the property setting for nudge interaction mode. If the nudge interaction mode is kQTVRNudgeRotate, the action of the QTVRInteractionNudge function is to rotate the object in the specified direction. If the nudge interaction mode is kQTVRNudgeTranslate, the action of the QTVRInteractionNudge function is to translate the image in the specified direction.

If the nudge interaction mode is kQTVRUNudgeSameAsMouse, the action of the QTVRInteractionNudge function is determined by the current mouse mode.

SPECIAL CONSIDERATIONS

The QTVRInteractionNudge function is valid only for object nodes.

SEE ALSO

Use the functions QTVRGetInteractionProperty and QTVRSetInteractionProperty to set the nudge mode and direction properties.

QTVRShowDefaultView

You can use the QTVRShowDefaultView function to display the default view of a node.

OSErr QTVRShowDefaultView (QTVRInstance qtvr);
qtvr
An instance of a QuickTime VR movie.
function result
A result code.

DISCUSSION

The QTVRShowDefaultView function sets the default values of the pan angle, tilt angle, field of view, view center (for object nodes), default state, mouse-down state, and all applicable animation and control settings for the node specified by the qtvr parameter. A node's default values are stored in the movie file.


© 1998 Apple Computer, Inc.

| Previous | Chapter Contents | Chapter Top | Next |